using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

using LDAP.Entity;

namespace LDAP.BLL
{
    public class BizAngel
    {
		public const string ENTITY_KEY = "angel";
		
        public static int Add(Angel entry)
        {
            object obj = Common.GetMapper(ENTITY_KEY, entry).Insert("Insert_Angel", entry);
            return 1;
        }

        public static int Update(Angel entry)
        {
            return Common.GetMapper(ENTITY_KEY, entry).Update("Update_Angel", entry);
        }

        public static Angel GetByKey(string id)
        {
            return Common.GetMapper(ENTITY_KEY, id).QueryForObject<Angel>("Select_Angel", id);
        }

        public static bool IsAngel(string id)
        {
            return GetByKey(id) != null;
        }

        public static IList<Angel> GetAll()
        {
            return Common.GetMapper(ENTITY_KEY, null).QueryForList<Angel>("Select_Angel", null);
        }

        public static int Delete(string id)
        {
           return Common.GetMapper(ENTITY_KEY, id).Delete("Delete_Angel",id);
        }
    }
}

	